﻿<%@ Page Title="Strategic Asset Management Las Vegas: Rehab" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
    CodeBehind="RehabList.aspx.cs" Inherits="LenderClearingHouse.RehabList" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="ListFilterControl.ascx" TagName="ListFilterControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphPageHeader" runat="server">
    Rehab
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMain" runat="server">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grid" UpdatePanelHeight="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

        <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SQLConnection %>"
            OnSelecting="SqlDataSource_Selecting" SelectCommand="getRehab"
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter ConvertEmptyStringToNull="False" Name="Apn" Type="String" />
                <asp:Parameter ConvertEmptyStringToNull="False" Name="PropLocation" Type="String" />
                <asp:Parameter ConvertEmptyStringToNull="False" Name="Zip" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    <fieldset>
    <legend>Parameters</legend>
        &nbsp;&nbsp;Days&nbsp;Variable:&nbsp;<asp:TextBox ID="tb5daysVariable" runat="server" ValidationGroup="percents"></asp:TextBox>&nbsp;&nbsp;
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" ValidationGroup="percents" />
        <br /><br />
    </fieldset>
    <br />
    <uc1:ListFilterControl ID="listFilter" runat="server" />
    <!--Panel Five: "Export & etc..."-->
    <div class="panel5">
        <table width="940" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="122" height="32" valign="middle">
                    &nbsp;
                </td>
                <td width="40" valign="middle">
                    <img src="images/excel_icon.png" width="30" height="30" />
                </td>
                <td width="137" valign="middle">
                    <asp:LinkButton ID="lnkExportToExcel" CssClass="link1" runat="server" OnClick="lnkExportToExcel_Click" Text="Export To Excel"></asp:LinkButton>
                </td>
                <td width="40" valign="middle">
                    <img src="images/refresh_icon.png" width="30" height="30" />
                </td>
                <td width="118" valign="middle">
                    <asp:LinkButton ID="lnkRefreshGrid" CssClass="link1" runat="server" OnClick="lnkRefreshGrid_Click" Text="Refresh Grid"></asp:LinkButton>&nbsp;
                </td>
                <td width="40" valign="middle">
                    
                </td>
                <td width="150" valign="middle" id="td1" runat="server">
                    
                </td>
                <td width="*">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <div class="panel7">
        <telerik:RadGrid ID="grid" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource" Width="1160px"
            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" 
            PageSize="10" ShowFooter="True" ShowStatusBar="True" 
            onupdatecommand="grid_UpdateCommand" onitemdatabound="grid_ItemDataBound" OnItemCreated="grid_ItemCreated"
            onpagesizechanged="grid_PageSizeChanged" SortCommand="grid_SortCommand">
            <GroupingSettings CaseSensitive="False" />
            <ClientSettings>
                <Scrolling ScrollHeight="500px" AllowScroll="True" UseStaticHeaders="True"/>
            </ClientSettings>
            <HeaderStyle Width="150px" />
            <MasterTableView DataSourceID="SqlDataSource" DataKeyNames="PropertyId">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="20px">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="InvestorName" HeaderText="Purchaser"
                        SortExpression="InvestorName" UniqueName="InvestorName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="StartDate" HeaderText="Recorded - F" SortExpression="StartDate" UniqueName="StartDate"
                        DataFormatString="{0:MM/dd/yyyy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Apn" HeaderText="Apn" SortExpression="Apn" UniqueName="Apn">
                    </telerik:GridBoundColumn>
                    <telerik:GridHyperLinkColumn 
                        DataTextField="PropertyLocation" HeaderText="Address" 
                        UniqueName = "Address" SortExpression = "PropertyLocation"
                        DataNavigateUrlFormatString="~/PropertyDetails2.aspx?propertyId={0}"
                        DataNavigateUrlFields="PropertyId">
                    </telerik:GridHyperLinkColumn>
                    <telerik:GridBoundColumn DataField="ZipCode" HeaderText="Zip" SortExpression="ZipCode"
                        UniqueName="ZipCode">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RehabStatus" HeaderText="Rehab Status" SortExpression="RehabStatus"
                        UniqueName="RehabStatus">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProjectManager" HeaderText="GC"
                        SortExpression="ProjectManager" UniqueName="ProjectManager">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RehabStartDate" DataType="System.DateTime" HeaderText="Rehab Start Date"
                        SortExpression="RehabStartDate" UniqueName="RehabStartDate" 
                        DataFormatString="{0:MM/dd/yyyy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="EstRehabCompDate" DataType="System.DateTime" HeaderText="Est Rehab Comp Date"
                        SortExpression="EstRehabCompDate" UniqueName="EstRehabCompDate" DataFormatString="{0:MM/dd/yyyy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ActualCompDate" DataType="System.DateTime" HeaderText="Actual Comp Date"
                        SortExpression="ActualCompDate" UniqueName="ActualCompDate" 
                        DataFormatString="{0:MM/dd/yyyy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CurrentRehabCosts" DataType="System.DateTime" HeaderText="Current Rehab Costs"
                        SortExpression="CurrentRehabCosts" UniqueName="CurrentRehabCosts" 
                        DataFormatString="{0:c}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NotesStatus" HeaderText="Notes - Status" SortExpression="NotesStatus"
                        UniqueName="NotesStatus" HeaderStyle-Width="200px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RehabEstimate" DataType="System.DateTime" HeaderText="Rehab Estimate"
                        SortExpression="RehabEstimate" UniqueName="RehabEstimate" 
                        DataFormatString="{0:c}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RehabMiscCosts" DataType="System.DateTime" HeaderText="Misc Costs"
                        SortExpression="RehabMiscCosts" UniqueName="RehabMiscCosts" 
                        DataFormatString="{0:c}">
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn DataField="PropertyId" DataType="System.Int64" HeaderText="PropertyId"
                        SortExpression="PropertyId" UniqueName="PropertyId" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PMId" DataType="System.Int64" HeaderText="PMId"
                        SortExpression="PMId" UniqueName="PMId" Visible="False">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" UserControlName="RehabEditControl.ascx">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
                <PagerStyle AlwaysVisible="True" />
            </MasterTableView>
            <PagerStyle AlwaysVisible="True" />
        </telerik:RadGrid>
    </div>
</asp:Content>
